var express = require('express');
var router = express.Router();
var dbConfig = require('../util/dbconfig');
/* GET home page. */
router.get('/', function (req, res, next) {
  // res.render('index', { title: 'Express' });
  var sql = "select * from book";
  var sqlArr = [];
  var callback = (err, data) => {
    if (err) {
      console.log('连接出错了');
    } else {
      res.send({
        'list': data
      })
    }
  };
  dbConfig.sqlConnect(sql, sqlArr, callback);
});

module.exports = router;
